import api from '../api.js'
//获取招标列表
export function getBiddingList(pageIndex, pageSize, search = '', domain) {
	return api.postFunction1('jhj.bidding.unusual', '_api_page', {
		page: pageIndex,
		limit: pageSize,
		search,
		domain: "[('bidding_state', '=', '确认中标')]",
	})
}
//获取招标列表 游客
export function getBiddingList2(pageIndex, pageSize, search = '', domain = '[]') {
	return api.postPubileApi('jhj.bidding.unusual', '_api_public_page', {
		page: pageIndex,
		limit: pageSize,
		search,
		domain
	})
}


//中标公告
export function getBiddingList3(pageIndex, pageSize, search = '', domain) {
	return api.postPubileApi('jhj.bidding.unusual', '_api_public_page', {
		page: pageIndex,
		limit: pageSize,
		search,
		domain:"[('bidding_state', '=', '确认中标')]"
	})
}
//中标详情
export function getBiddingDetails(unusual_id) {
	return api.postPubileApi('jhj.bidding.unusual', '_api_public_one', {
		unusual_id
	})
}


export function getBiddingDetail(id) {
	return api.postFunction('jhj.bidding.unusual', '_api_one', {
		unusual_id: id
	})
}

export function getBiddingDetail2(id) {
	return api.postPubileApi('jhj.bidding.unusual', '_api_public_one', {
		unusual_id: id
	})
}
//报名
export function apply(fieldModel) {
	return api.create('jhj.bidding.process', fieldModel)
}
//判断是否已经报名
export function getProcessList(orderId, userId) {
	return api.readPage('jhj.bidding.process', 'id', 1, 1, `[('order_id','=',${orderId}),('user_id','=',${userId})]`)
}
export function getUnusualData(id) {
	return api.postFunction('jhj.bidding.unusual', '_api_one', {
		unusual_id: id
	})
}
